package javaCode.chapter09.interface_;

public class InterfacePolyParameter {
    public static void main(String[] args) {
        //接口体现多态
        //接口变量if01 可以指向实现了IF接口的对象实例
        IF if01 = new Monster();
        if01 = new Car();

        //继承体现多态
        //父类类型变量aa 可以指向子类对象实例
        AA aa = new BB();
        aa = new CC();
    }
}

interface IF{}
class Monster implements IF{}
class Car implements IF{}

class AA{}
class BB extends AA{}
class CC extends AA{}